import {Component,Input,ViewChild } from '@angular/core';
import{ModuleComponent} from './module.component';
@Component({
selector:"[capacity-component]",
templateUrl:'./index.html'
})
class CapacityComponent {
    // 获取子组件的实例@ViewChild
    @ViewChild(ModuleComponent) childSelf:ModuleComponent;
    childMethod(){
        this.childSelf.childMethod(
           
        );
    }
    listTem = [
        { id: 11, name: 'Mr. Nice' },
        { id: 12, name: 'Narco' },
        { id: 13, name: 'Bombasto' },
      ];
   name  = "智能页面";
   isShow = true;
   childData= "";
//    测试子组件set方法
   add(){
       this.listTem.push({ id: 16, name: '增加'})
    
   }
   getChildData(data){
   this.childData = data
     alert("给父组件传递数据："+data)
   };
   change(){
    this.isShow = !this.isShow;
   }

}

export {CapacityComponent}